import 'package:flutter/material.dart';

class CarNav{


  carItem({required IconData carIcon, required String carName, required String carPrice, required String carDesc, GestureTapCallback? onTap}){
    return  GestureDetector(
      onTap: onTap,
      child: Padding(
        padding: EdgeInsets.fromLTRB(16, 5, 16, 5),
        child: Row(
          children: [
            Flexible(flex:4,  fit:FlexFit.loose ,child: Icon(carIcon,size: 32,),),
            const Flexible(
                flex: 2,
                fit:FlexFit.loose,
                child: SizedBox(
                  height: 40,
                  child:  VerticalDivider(
                    thickness: 1,
                    width: 20,
                    color: Colors.black12,
                  ),
                )
            ),
            Expanded(
                flex: 32,
                child: Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  verticalDirection: VerticalDirection.down,
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: [
                    Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        Expanded(
                          child:  Padding(
                            padding: const EdgeInsets.fromLTRB(0,6,20,6),
                            child: Text(carName,
                              style: const TextStyle(overflow: TextOverflow.ellipsis,fontSize: 15,fontWeight: FontWeight.bold),
                              maxLines: 1,
                            ),
                          ),
                        ),
                        Row(children: [
                          const Text("在售车辆：",style:  TextStyle(color: Colors.red,fontSize: 15,fontWeight: FontWeight.bold)),
                          Text(carPrice,style: const TextStyle(color: Colors.red,fontSize: 15,fontWeight: FontWeight.bold),),
                          const Text("万",style: TextStyle(color: Colors.red,fontSize: 15,fontWeight: FontWeight.bold)),
                        ])
                      ],
                    ),
                    Text(
                      carDesc,
                      style: const TextStyle(overflow: TextOverflow.ellipsis) ,
                      maxLines: 1,
                    )
                  ],
                )
            )
          ],
        ),
      ),
    );
  }

}

CarNav carNav = CarNav();


